home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha Extra 2004 January / CyberMycha Extra 1-2004 (Poland) (Disc 2).bin / Pippi / common.cst / 00010_autoMoveScript.ls < prev    next >
Encoding:
Text File  |  2001-09-04  |  788 b   |  32 lines

  1. on new me
  2.   return me
  3. end
  4.  
  5. on autoMove me, pSprite, pLoc, pRot --pLoc: funkar med loc och rect, p├Ñ rect tar han det ├╢vre v├ñnstra h├╢rnet och g├╢r en loc av!
  6.   if pRot <> void then --rotationOption
  7.     firstRot = pSprite.rotation
  8.     divideThis = firstRot - pRot
  9.     dividum = divideThis / 5
  10.     pSprite.locZ = 155
  11.   else
  12.     pSprite.locZ = 100
  13.   end if
  14.   goalLoc = point(pLoc[1], pLoc[2])
  15.   repeat with n = 1 to 5
  16.     t = the ticks + 3
  17.     repeat while the ticks < t
  18.     end repeat
  19.     firstLoc = pSprite.loc
  20.     middleLoc = goalLoc + ((firstLoc - goalLoc) / 2)
  21.     pSprite.loc = middleLoc
  22.     if pRot <> void then
  23.       pSprite.rotation = pSprite.rotation + dividum
  24.     end if
  25.     updateStage
  26.   end repeat
  27.   pSprite.locZ = pSprite.spriteNum
  28.   pSprite.loc = goalLoc
  29.   updateStage
  30. end
  31.  
  32.